<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        xxx = "outer xxx";

        console.log(xxx); // 运行结果：outer xxx

        function testFtn() {

            sss = "inner sss";

            console.log(sss); // 运行结果：outer sss

        }

        testFtn();

        console.log(sss); //运行结果：outer sss

        console.log(window.sss); //运行结果：outer sss
    </script>
</body>

</html>